import axios from 'axios';
let service = axios.create({
    baseURL:'http://localhost:8888',
    timeout:10000,
})

//请求拦截器
/*service.interceptors.request.use(
    config=>{
        let token = sessionStorage.getItem('token')
        //如果token不为null，token给后台
        if(token){
            config.headers['Token'] = token
        }
        return config
    },
    error=>{
        Promise.reject(error)
    },
)
//响应拦截器
service.interceptors.response.use(
    response=>{
        let res = response.data;
        if(res.message==='ok'){
            return res
        };
        return res
    },
    error=>{
        Promise.reject(error)
    },
)*/
export default service